﻿// The MIT License (MIT)

// Copyright (c) 2014 Md Ishtiaque Shahrier (Exico software solutions www.exico.ca)

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ExicoSoftwareSolutions.WebTools.MvcPagination
{
    public class PagerOptions
    {
        public string NextText { get; set; }//the text for the next link
        public string PrevText { get; set; }//text for the previous link
        public string FirstText { get; set; }//text for the first link
        public string LastText { get; set; }//text for the first link
        public string WrapperDivClass { get; set; }//the class name for the div that sorrounds the links
        public Boolean ShowFirstAndLast { get; set; }//toggle on and off displaying the "First" and "Last" link
        public Boolean ShowNextAndPrev { get; set; }//toggle on and off displaying the "Prev" and "Next" link
        public string Controller { get; set; }//if a controller is specified
        public string Action { get; set; }//if an action is specified
        public string PageParam { get; set; }//the page url param default is "page"  
        public Boolean ShowEvenOnlyOnePage { get; set; }//render the pager even if there is only one page
        public int NumberOfPagesToDisplay { get; set; } // the number of page links that will be shown on a page

        public PagerOptions()
        {
            this.PageParam = "page";
            this.WrapperDivClass = "pages";
            this.ShowFirstAndLast = true;
            this.ShowNextAndPrev = true;
            this.FirstText = "First";
            this.LastText = "Last";
            this.NextText = ">";
            this.PrevText = "<";
            this.Controller = null;
            this.Action = null;
            this.ShowEvenOnlyOnePage = false;
            this.NumberOfPagesToDisplay = 0; //will display links for every page number by default
            this.ShowSummary = false;
            this.SummaryFormat = "Page: {0}/{1}";

        }

        public bool ShowSummary { get; set; } //i.e. sshowing page 1/10
        public string SummaryFormat { get; set; } // you should pass like "showing page {0} of {1}"

    }
}
